/*
 * BuildCommand.h
 *
 *  Created on: Oct 14, 2008
 *      Author: Ryan
 */

#ifndef BUILDCOMMAND_H_
#define BUILDCOMMAND_H_

#include "Command.h"
#include "../Point3.h"
#include "../Direction.h"
#include "../Units/Unit.h"

namespace OOInterface
{

/**
 * Encapsulates the concept of building structures on a map. Units are expected to
 * have the BuildingAspect. Depending on the game this is being used with, the
 * facing argument may serve no purpose or do nothing.
 *
 */
class BuildCommand: public OOInterface::Command
{
public:

	/*
	 * BuildCommand( ... ) :
	 * Constructs a build command to be sent to a builder unit.
	 *
	 * @param unit The building to be built. Should have a BuildingAspect.
	 * @param position The location (centered) the building should be built at.
	 * 					This should be regarded as a best effort attempt.
	 * @param facing The front of the building should be facing. (if applicable)
	 */
	BuildCommand( ConstUnitPtr unit, const Point3f& position, const Direction& facing = NULL );
	virtual ~BuildCommand();

	void setUnit( ConstUnitPtr unit );
	ConstUnitPtr getUnit() const;

	void setLocation( const Point3f& pos);
	const Point3f& getLocation() const;

	void setDirection( const Direction& facing );
	const Direction& getDirection() const;

	virtual std::string toString() const;

private:
	ConstUnitPtr _unit;
	Point3f _location;
	Direction _orientation;
};

}

#endif /* BUILDCOMMAND_H_ */
